# encoding: UTF-8
 
class Topic < ActiveRecord::Base

  attr_accessible :category, :content, :status, :title

  scope :open_status, where(:status => 0)

  scope :full, where(:category => 1)
  scope :main, where(:category => 2)
  scope :game, where(:category => 3)
  scope :fixs, where(:category => 4)

  def self.category(cid)
    Node.where("id=?", cid).pluck("title")
  end

  def self.categories
    Node.find_all_by_category(1)
  end

end
